package com.ai.web.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ai.web.service.ICashDeviceService;
import com.ai.web.vo.ICashDeviceV;
import com.ai.web.vo.ResultModel;
import com.tiny.persistence.domain.ICashDevice;
import com.tiny.persistence.repository.ICashDeviceRepo;

@Service
public class ICashDeviceServiceImpl extends
		BaseServiceImpl<ICashDevice, String, ICashDeviceV> implements
		ICashDeviceService {

	@Autowired
	private ICashDeviceRepo iCashDeviceRepo;

	@Autowired
	public ICashDeviceServiceImpl(ICashDeviceRepo iCashDeviceRepo) {
		super(iCashDeviceRepo);
	}

	public ICashDeviceV get(String id) throws Exception {
		return getT(id);
	}

//	public ICashDevice getBySerialNumber(String serialNumber) throws Exception {
//		return iCashDeviceRepo.getBySerialNumber(serialNumber);
//	}
	
	public ResultModel save(ICashDeviceV iCashDeviceV) throws Exception {
		ICashDeviceV saveV = saveT(iCashDeviceV);
		ResultModel rm = new ResultModel();
		rm.setData(saveV);
		rm.setSuccessCode();

		return rm;
	}

}
